/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author Administrator
 */
public class NewServlet2 extends HttpServlet {

   

    // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
    /**
     * Handles the HTTP <code>GET</code> method.
     *
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
       doPost(request,response);
    }

    /**
     * Handles the HTTP <code>POST</code> method.
     *
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
       String data = "[{\"models\":\"橱下RO机(123)\",\"imgs\":\"YYD1384244317546_1.jpg,YYD1384244317546_2.jpg,YYD1384244317546_3.jpg,YYD1384244317546_4.jpg,YYD1384244317546_5.jpg,YYD1384244317546_6.jpg\",\"username\":\"张锦华\",\"yuyuedanID\":\"YYD1384244317546\",\"address\":\"fasdffsdaf\",\"tel\":\"15906043148\",\"paiGongTime\":\"2013-11-12\",\"needSerialCode\":0,\"xiaoshoudanId\":\"XSD13775080510936\"},{\"models\":\"橱下超滤机(MU131-5)\",\"imgs\":\"YYD1387337582984_1.jpg,YYD1387337582984_2.jpg,YYD1387337582984_3.jpg\",\"username\":\"王磊\",\"yuyuedanID\":\"YYD1387337582984\",\"address\":\"内蒙古自治区 呼伦贝尔市 满洲里市富江国际6号楼3单元302\",\"tel\":\"13847003112\",\"paiGongTime\":\"2013-12-18\",\"needSerialCode\":0,\"xiaoshoudanId\":\"XSD1383275596960\"},{\"models\":\"橱下超滤机(MU131-5)\",\"imgs\":\"YYD1387337587125_1.jpg\",\"username\":\"王磊\",\"yuyuedanID\":\"YYD1387337587125\",\"address\":\"内蒙古自治区 呼伦贝尔市 满洲里市富江国际6号楼3单元302\",\"tel\":\"13847003112\",\"paiGongTime\":\"2013-12-18\",\"needSerialCode\":0,\"xiaoshoudanId\":\"XSD1383275613159\"},{\"models\":\"橱下超滤机(MU131-5)\",\"imgs\":\"YYD1387337592265_1.jpg\",\"username\":\"王磊\",\"yuyuedanID\":\"YYD1387337592265\",\"address\":\"内蒙古自治区 呼伦贝尔市 满洲里市富江国际6号楼3单元302\",\"tel\":\"13847003112\",\"paiGongTime\":\"2013-12-18\",\"needSerialCode\":0,\"xiaoshoudanId\":\"XSD1383275595074\"},{\"models\":\"橱下超滤机(MU131-5)\",\"imgs\":\"YYD1387337595921_1.jpg\",\"username\":\"王磊\",\"yuyuedanID\":\"YYD1387337595921\",\"address\":\"内蒙古自治区 呼伦贝尔市 满洲里市富江国际6号楼3单元302\",\"tel\":\"13847003112\",\"paiGongTime\":\"2013-12-18\",\"needSerialCode\":0,\"xiaoshoudanId\":\"XSD1383274268045\"},{\"models\":\"橱下RO机( )\",\"imgs\":\"\",\"username\":\"清二代\",\"yuyuedanID\":\"YYD1397036594717\",\"address\":\"123\",\"tel\":\"13960475977\",\"paiGongTime\":\"2014-04-09\",\"needSerialCode\":0,\"xiaoshoudanId\":\"XSD13832909969741\"},{\"models\":\"橱下RO机(MRO121-4)\",\"imgs\":\"\",\"username\":\"沈立\",\"yuyuedanID\":\"YYD1397036604514\",\"address\":\"浙江省 金华市 婺城区 亚峰路1号瑞城名座6楼A\",\"tel\":\"13586980332\",\"paiGongTime\":\"2014-04-09\",\"needSerialCode\":0,\"xiaoshoudanId\":\"XSD1383275605068\"},{\"models\":\"橱下RO机(MRO121-4)\",\"imgs\":\"\",\"username\":\"沈立\",\"yuyuedanID\":\"YYD1397036609381\",\"address\":\"浙江省 金华市 婺城区 亚峰路1号瑞城名座6楼A\",\"tel\":\"13586980332\",\"paiGongTime\":\"2014-04-09\",\"needSerialCode\":0,\"xiaoshoudanId\":\"XSD1383275601409\"},{\"models\":\"橱下RO机(MRO121-4)\",\"imgs\":\"\",\"username\":\"李海珍\",\"yuyuedanID\":\"YYD1397036615597\",\"address\":\"河南省 新乡市 其它区 新区新四街与荣校东路西北角阳光365售楼部\",\"tel\":\"13937348833\",\"paiGongTime\":\"2014-04-09\",\"needSerialCode\":0,\"xiaoshoudanId\":\"XSD1383275613416\"},{\"models\":\"橱下RO机(MRO101-5)\",\"imgs\":\"\",\"username\":\"释正阳\",\"yuyuedanID\":\"YYD1397036623305\",\"address\":\"安徽省 合肥市 庐江县 汤池镇白云禅寺\",\"tel\":\"18055120930\",\"paiGongTime\":\"2014-04-09\",\"needSerialCode\":0,\"xiaoshoudanId\":\"XSD1383209698349\"}] ";
		

		response.setContentType("text/html;charset=gb2312");
response.setHeader("Access-Control-Allow-Origin", "*");
            try (PrintWriter out = response.getWriter()) {
                out.println(data);
                out.flush();
            }
    }

    /**
     * Returns a short description of the servlet.
     *
     * @return a String containing servlet description
     */
    @Override
    public String getServletInfo() {
        return "Short description";
    }// </editor-fold>

}
